<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no"/>
<meta charset="UTF-8">
<div style="display:none"><img src="/images/product-promotion/product-promotion-poster.png"></div>
<title>禁飞区查询</title>

<link href="/css/vendor/common.css" type="text/css" rel="stylesheet">
<link href="/css/vendor/cmp-controls.css" type="text/css" rel="stylesheet">
<link href="/css/vendor/nofly-request.less" type="text/css" rel="stylesheet/less">
<script src="/js/less.min.js"></script>
</head>

<body>
    <!-- 地图 -->
    <div class="map-wrap">
        <div id="map"></div>
    </div>
    
    <!-- 地址搜索输入框 -->
    <div class="place-box" place>
        <div class="switch-btn button" onClick="placeSearchM.changeMode(this)"></div>
        <input id="place-search-input" type="text" placeholder="可输入国家 、城市、机场名称等">
        <div id="coord-search-input">
                <p>纬度: </p><input class="lat" type="text">
                <p>经度: </p><input class="lon" type="text">
        </div>
        <p class="search-btn button" onClick="placeSearchM.clickSearch(this)">查 询</p>
    </div>
</body>

<script type="text/javascript" src="http://maps.google.cn/maps/api/js?key=AIzaSyDOMhmWUde8faeEPDk1_OamryGNdBCzXEc"></script>
<script src="/js/baidu-statistics.js"></script>
<script src="/js/jquery.min.js"></script>
<script src="/js/vendor/common.js"></script>
<script src="/js/vendor/transform.js"></script>
<script src="/js/vendor/cmp-controls.js"></script>
<script src="/js/vendor/nofly-request.js"></script>
<script>    
    $(function(){
        function getQueryString(name)
        {
             var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
             var r = window.location.search.substr(1).match(reg);
             if(r!=null)return  unescape(r[2]); return null;
        }

        var swLat = getQueryString("swLat");
        var swLng = getQueryString("swLng");
        var neLat = getQueryString("neLat");
        var neLng = getQueryString("neLng");
        if (swLat && swLng && neLat && neLng) {
            console.log(" " + swLat+" " +swLng +" " +neLat +" " +neLng);
            var rectangle = new google.maps.Rectangle({
                strokeColor: '#31FF59',
                strokeWeight: 2,
                fillColor: '#00CC03',
                fillOpacity: 0.44,
                map: mapM.map,
                zIndex: 9,
                bounds: {
                    north: parseFloat(neLat),
                    south: parseFloat(swLat),
                    east: parseFloat(neLng),
                    west: parseFloat(swLng)
                }
            });
            mapM.map.setCenter({lat:((parseFloat(swLat) + parseFloat(neLat)) / 2), lng:((parseFloat(swLng) + parseFloat(neLng)) / 2)});
        }
    });
    
</script>

